//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef _FrequencyLINGO_h_
#define	_FrequencyLINGO_h_
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <time.h>
#include <mpi.h>

#include "libraries.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#define	ARRAYSIZE    600000
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
class FrequencyLINGO {

  private:

    time_t            initialTime;
    time_t            finalTime;

    int               err;
    int               rank;
    int               sizeRank;

    MPI_Request       reqs[ARRAYSIZE];
    MPI_Status        stat;

    String*           filenameIn;
    String*           filenameOut;

    TListE <String>*  listLingo;
    int               sizeLingo;

  protected:

    char*             ShowTime(char*);
    bool              CreateVirtualFlagsInFile(long*);
    
  public:

    FrequencyLINGO();
    FrequencyLINGO(FrequencyLINGO*);
    FrequencyLINGO(const FrequencyLINGO&);
    
    ~FrequencyLINGO();

    void              InitialTime(time_t);
    void              FinalTime(time_t);
    
    void              FilenameIn(String*);
    void              FilenameOut(String*);

    void              ListLingo(TListE <String>*);
    void              SizeLingo(int);

    String*           FilenameIn(String*);
    String*           FilenameOut(String*);

    TListE <String>*  ListLingo(TListE <String>*);
    void              SizeLingo(int);

    void              Err(int);
    void              Rank(int);
    void              SizeRank(int);

    int               Err();
    int               Rank();
    int               SizeRank();
    
    MPI_Request       Reqs(int);
    MPI_Status        Stat();

    bool              FindLingo(int, char**);

    FrequencyLINGO    operator=(const FrequencyLINGO&);

};
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
